package com.TeamJigsaw.DanteTrail.Models;

import java.awt.Image;

/**
 * Represents a PartyMember
 * @author David Chi
 *
 */
public class PartyMember {
	protected String name;
	
	protected int health;
	
	protected int status;
	
	protected Image memberPic;
	
	//static constants
	private static final int DEFAULT_HEALTH = 0;
	
	private static final int DEFAULT_STATUS = 0;
	
	/**
	 * Creates and initializes PartyMember with specified name
	 * @param name The name of the partymember
	 */
	public PartyMember(String name) {
		this.name = name;
		health = DEFAULT_HEALTH;
		status = DEFAULT_STATUS;
	}
	
	/**
	 * Creates and intializes the PartyMember with 
	 * specified name and picture
	 * @param name The name of the PartyMember
	 * @param memberPic The picture of the PartyMember
	 */
	public PartyMember(String name, Image memberPic) {
		this(name);
		this.memberPic = memberPic;
	}

	/**
	 * Gets and returns the party member name
	 * @return The name of the party member
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the party member name to a new value
	 * @param name The party member's new name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets and returns the health of the party member
	 * @return The health of the party member
	 */
	public int getHealth() {
		return health;
	}

	/**
	 * Sets the health of the party member to a new value
	 * @param health The new health of the party member
	 */
	public void setHealth(int health) {
		this.health = health;
	}

	/**
	 * Gets and returns the status of the party member
	 * @return The status of the party member
	 */
	public int getStatus() {
		return status;
	}

	/**
	 * Sets the status of the party member
	 * @param status The new status of the party member
	 */
	public void setStatus(int status) {
		this.status = status;
	}
	
	/**
	 * Gets and returns the picture of the party member
	 * @return The picture of the party member 
	 */
	public Image getPicture() {
		return memberPic;
	}
	
	/**
	 * Sets the party membmer picture to a new picture
	 * @param memberPic The new picture for the party member
	 */
	public void setPicture(Image memberPic) {
		this.memberPic = memberPic;
	}
	
	/**
	 * Returns a string representation of the party member. 
	 * @return A string representation of the party member. 
	 */
	@Override
	public String toString() {
		String returnVal = "";
		returnVal += "This party member's name is " + name + ".\r\n";
		returnVal += "The status is " + status + ".\r\n";
		returnVal += "The health is " + health + ".\r\n";
		
		return returnVal;
	}
}
